package com.torry.edss.integration.feign.mairui;

import com.torry.edss.integration.feign.mairui.response.MairuiAllStocksResponse;
import com.torry.edss.integration.feign.mairui.response.MairuiRealTimeKLineResponse;
import com.torry.edss.integration.feign.mairui.response.MairuiShareholderChangeTrendResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author torry.wang
 */
@FeignClient(name = "mairuiFeignClient", url = "http://v.mairuiapi.com")
public interface MairuiFeignClient {

    String LICENSE = "1a69f53029463e9d61";

    /**
     * 全部股票实时交易数据接口 暂时没有权限调用
     */
    @GetMapping("/hsrl/ssjy/all/" + LICENSE)
    List<MairuiRealTimeKLineResponse> fetchAllStockRealTimeKLine();


    /**
     * 指定股票 实时交易数据接口
     */
    @GetMapping("/hsstock/real/time/{code}/" + LICENSE)
    MairuiRealTimeKLineResponse fetchRealTimeKLine(@PathVariable(name = "code") String code);


    /**
     * 两市股票列表,不含北交所  数据更新：每日16:20
     */
    @GetMapping("/hslt/list/" + LICENSE)
    List<MairuiAllStocksResponse> fetchAllStocks();


    /**
     * 获取指定公司的股东变化趋势  数据更新：每日03:30
     */
    @GetMapping("/hscp/gdbh/{code}/" + LICENSE)
    List<MairuiShareholderChangeTrendResponse> fetchShareholderChangeTrend(@PathVariable(name = "code") String code);

}